<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
	<!-- 引入easyui 的主题样式  和  easyui 提供的图标样式 -->
	<link rel="stylesheet"
		href="${pageContext.request.contextPath}/themes/bootstrap/easyui.css" />
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/themes/icon.css">
	<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-1.9.1.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.easyui.min.js"></script>
	<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/easyui-lang-zh_CN.js"></script>

	
</head>
<script type="text/javascript">
	$(function() {
		//树形菜单的展示
		$('#tt').tree({
			url : 'showFuncs',
			
			onLoadSuccess : function(node, data) {
				$('#tt').tree('expandAll');

			},
			onClick : function(node) {
				if (node.attributes.furl) {
					if ($('#content').tabs('exists', node.text)) {
						$('#content').tabs('select', node.text)
					} else {
						$('#content').tabs('add', {
							title : node.text,
							content : 
								"<iframe  frameborder='no' width='100%' height='100%' src="+ node.attributes.furl +"></iframe>",
							closable : true
						});
					}
				}

			}
		});
		//实现上班签到
       $("#btn").linkbutton({
    	   onClick:function(){
    		   $.ajax({
    			   url:"sbqd",
    			   type:"post",
    			   success:function(data){
    				   if(data==0){
    					   $("#btn").linkbutton({
    			        		onClick:function(){
    			        		disabled=true;
    			        		}
    			        	}); 
    					   $.messager.alert('提示', '今天已签到');
    				   }else{
    					 if(data=="true"){
   				        	$.messager.alert('提示', '申请成功');
   				          }else{
   				        	$.messager.show({
   				        		title:'信息提示',
   				        		msg:'提交失败',
   				        		timeout:1000,
   				        		showType:'slide'
   				        	})
   				        }
    				   }
    			   }
    		   })
    	   }
       });
		//实现下班签到
       $("#bt").linkbutton({
    	   onClick:function(){
    		   $.ajax({
    			   url:"xbqd",
    			   type:"post",
    			   success:function(data){
    				   if(data==0){
    					   $("#bt").linkbutton({
    			        		onClick:function(){
    			        		disabled=true;
    			        		}
    			        	});
    					   $.messager.alert('提示', '今天已签到');
    				   }else{
    					   if(data=="true"){
      				        	$.messager.alert('提示', '申请成功');
      				          }else{
      				        	$.messager.show({
      				        		title:'信息提示',
      				        		msg:'提交失败',
      				        		timeout:1000,
      				        		showType:'slide'
      				        	})
      				        }
    				   }
    			   }
    		   })
    	   }
       });
	})
</script>
<body class="easyui-layout">
	<div data-options="region:'north',border:false" style="height:60px;background:#B3DFDA;padding:10px">欢迎来到xxx员工管理系统
	<span>
	    <a id="btn" href="#" class="easyui-linkbutton" style="position:relative;left:74%">上班签到</a>
	    <a id="bt" href="#" class="easyui-linkbutton" style="position:relative;left:75%">下班签到</a>
	</span>
	<form action="tcdl" method="post">
	　　<div>
	   <button type="submit" class="easyui-linkbutton"  style="position:relative;left:96%;top:-38px">退出登录</button>
	   </div>
	</form>
	</div>
	<div data-options="region:'west',split:true,collapsible:false,title:'${sessionScope.user.username},欢迎你'" style="width:150px;padding:10px;">
		<!-- 功能展示 -->
		<ul id="tt"></ul>
	</div>
	<div data-options="region:'south',border:false" style="height:50px;background:#A9FACD;padding:10px;">south region</div>
	<div data-options="region:'center',title:'Center'">
		<div id="content" class="easyui-tabs" data-options="fit:true">

		</div>
	</div>

</body>
</html>